package com.GUI.Lesson06;
//文本框
import javax.swing.*;
import java.awt.*;

public class TextDemo02 extends JFrame {
    public TextDemo02(){
        Container container = this.getContentPane();

        JTextField textField = new JTextField("Hello");
        JTextField textField2 = new JTextField("World",20);

        container.add(textField,BorderLayout.NORTH);
        container.add(textField2,BorderLayout.SOUTH);
        //基本
        this.setVisible(true);//没有命名冲突的话才可以省略this
        this.setBounds(10,10,200,200);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    }

    public static void main(String[] args) {
        new TextDemo02();
    }
}
